package com.itheima.d2_collection_nesting;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;

/*
      目标：理解集合的嵌套。
      江苏省 = "南京市","扬州市","苏州市","无锡市","常州市"
      湖北省 = "武汉市","孝感市","十堰市","宜昌市","鄂州市"
      河北省 = "石家庄市","唐山市", "邢台市", "保定市", "张家口市"
 */
public class Test {
    public static void main(String[] args) {
        HashMap<String, ArrayList<String>> map = new HashMap<>();
        ArrayList<String> js = new ArrayList<>();
        ArrayList<String> hub = new ArrayList<>();
        ArrayList<String> heb = new ArrayList<>();
        Collections.addAll(js, "南京市", "扬州市", "苏州市", "无锡市", "常州市");
        Collections.addAll(hub, "武汉市", "孝感市", "十堰市", "宜昌市", "鄂州市");
        Collections.addAll(heb, "石家庄市", "唐山市", "邢台市", "保定市", "张家口市");

        map.put("江苏省", js);
        map.put("湖北省", hub);
        map.put("河北省", heb);

        map.forEach((k,v)->{
            System.out.print(k+": ");
            for (String s : v) {
                System.out.print(s+ " ");
            }
            System.out.println();
        });


    }
}
